<template>
  姓名:{{person.name}}  年龄:{{person.age}}<br>
<!--  <button @click="person.name+='-'"></button>-->
<!--  <button @click="person.age++"></button>-->
<button @click="updateName"></button>
  <button @click="updateAge"></button>
</template>

<script lang="ts" setup>

  import {ref} from "vue";

  const person=ref({
    name:'张三',
    age:18
  })
  const updateName=()=>{
    person.value.name+='-'
  }
  const updateAge=()=>{
    person.value.age++
  }
</script>

<style>

</style>
